package com.lcf.user.error;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.util.HashMap;
import java.util.Map;

@ControllerAdvice
public class GlobalError {

    @ExceptionHandler(RuntimeException.class)
    public Map<String, Object> resulltError(RuntimeException ex) {
        Map<String, Object> map = new HashMap<>();
        map.put("errCode", 500);
        map.put("errCode", "失败原因" + ex.getMessage());

        ex.getStackTrace();
        return map;
    }
}
